package com.egao.common.module.notice.utils;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 企业号推送记录导出实体模板
 * @author root
 */
@Data
public class NoticeRecordExport {

    @ApiModelProperty(value = "学工号")
    private String xh;

    @ApiModelProperty(value = "发送状态")
    private String state;

    @ApiModelProperty(value = "发送状态描述")
    private String description;

    @ApiModelProperty(value = "发送时间")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_MINUTE_PATTERN)
    private Date createTime;

    public String getState() {
        if ("0".equals(state)) {
            return "成功";
        } else {
            return "失败";
        }
    }
}
